<div class="ms-frame" ng-controller="ServiceCtrl">
  <!-- header -->
  <div class="frame-h">
    <div class="frame-h-act">
      <a ui-sref="home" class="frame-h-act-btn ms-back-btn"></a>
    </div>
    <h3 class="frame-h-ctx">Manage Services</h3>
    <div class="frame-h-act-rt">
      <a ui-sref="home" class="frame-h-act-btn ms-home-btn"></a>
    </div>
  </div><!-- /header -->
  <!-- content 1 -->
  <div class="content-1">
    <p class="content-1-p">
      Your Public ID is: <b>{{longName}}</b>
    </p>
  </div><!-- /content 1 -->
  <div class="content-1">
    <!-- <h3 class="content-1-h">Manage Services</h3> -->
    <p class="content-1-p">
      Here you can view and edit the services you currently have.<br/>
      There is no limit to how many you can create but they must all be unique within your public id.
    </p>
  </div><!-- /content 1 -->
  <div>
    <h3 ng-if="!longName" class="heading-1"><a ui-sref="publicID">Create a Public ID to register a service</a></h3>
    <div ng-if="longName" ng-init="getServices()">
      <div class="container-2 text-center">
        <a ui-sref="createService" class="ms-btn ms-primary-btn">Create New</a>
      </div>
      <h3 class="heading-1" ng-show="serviceList.length === 0">No service registered</h3>
      <div class="ms-list-1" ng-show="serviceList.length > 0">
        <div class="ms-list-1-i" ng-repeat="service in serviceList">
          <div class="ms-list-1-i-ctx">
            <span class="url"><a href=""
                ng-click="openExternal('safe://' + service.name + '.' + service.longName + '.safenet')">
                safe://<b>{{ service.name }}</b>{{ '.' + service.longName }}</a></span>
            <span ng-if="service.homeDir" class="path">/public/{{service.homeDir}}</span>
            <span ng-if="!service.homeDir" class="path error">Home Directory Not Found</span>
          </div>
          <div class="ms-list-1-i-act-lt">
            <a href="" class="danger" ng-click="deleteService(service.name)">DELETE</a>
          </div>
          <div class="ms-list-1-i-act">
            <a ng-if="service.homeDir" ui-sref="serviceExplorer({serviceName: service.name, servicePath: 'public/' + service.homeDir })">Edit Files</a>
            <a ui-sref="managePublicData({serviceName: service.name, remap: true, folderPath: 'public'})">Remap DNS</a>
            <!-- <a href="" ng-click="openLink(service.name, service.longName)">Visit Site</a> -->
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
